<template>
  <el-table
    :data="data"
    style="width: 100%"
  >
    <el-table-column
      prop="id"
      label="id"
      width="90"
    >
    </el-table-column>
    <el-table-column
      prop="name"
      label="分类名称"
      width="130"
    />
    <el-table-column
      prop="date"
      label="分类封面"
      width="230"
    >
      <template slot-scope="data">
            <el-image
              style="width: 100px; height: 100px"
              :src="data.row.icon"
              :fit="fit"></el-image>

      </template>
    </el-table-column>

    <el-table-column
      prop="date"
      label="是否展示"

    >
    <template slot-scope="data">
      <div>{{ data.row.show == 1?'是':'否' }}</div>
    </template>
  </el-table-column>

    <!-- <el-table-column
      prop="date"
      label="类别介绍"
      width="180"
    >
    </el-table-column> -->

    <el-table-column
      prop="date"
      label="操作"
      fixed="right"
      width="180"
    >
      <template slot-scope="scope">
        <el-button type="primary" size="small" @click.native="editItem(scope.row)">编辑</el-button>
        <el-button type="danger" size="small" @click.native="delItem(scope.row)">删除</el-button>
      </template>
    </el-table-column>>
  </el-table>
</template>

<script>

export default ({
  name: 'CateTable',
  props:['data'],
  data() {
    return {
      
    }
  },
  methods:{
    editItem(row) {
      this.$emit("editHandle",{data:row});
    },
    delItem(row) {
      this.$emit("delHandle",{data:row});
    }
  }


})

</script>
